package com.itita.ww2.handler.requesthandler.user;

import java.sql.SQLException;

import com.itita.ww2.core.MessageHandler;
import com.itita.ww2.core.WW2Exception;
import com.itita.ww2.game.user.UserService;
import com.itita.ww2.model.user.UserProfile;
import com.itita.ww2.utils.handler.IRequestOper;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;

/**
 * 获取月卡信息
 * @author NorthLan
 *
 */
public class GetMonthlyCardInfo implements IRequestOper {
	// private static final Logger logger = LoggerFactory.getLogger(GetMonthlyCardInfo.class);

	@Override
	public boolean execute(String requestCMD, User user, ISFSObject params) throws WW2Exception, SQLException {
		UserProfile userProfile = UserService.getInstance().getUserProfile(user);

		ISFSObject backObj = userProfile.getPaymentMgr().getMonthlyCardUtil().getMonthlyCardInfo();

		// logger.info(backObj.toJson());

		MessageHandler.getInstance().sendMsg(requestCMD, backObj, user, null, true);
		return true;
	}

}
